//import './assets/main.css'
// 导入ElementPlus组件
import ElementPlus from 'element-plus'
// 导入ElementPlus 的  css
import 'element-plus/dist/index.css'
// 引入图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//导入pinia持久化文件
import PiniaPluginPersist from 'pinia-plugin-persist'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

const app = createApp(App)
const pinia = createPinia()
// pinia使用持久化对象
pinia.use(PiniaPluginPersist)

//vue 对象使用pinia
app.use(pinia)
app.use(router)
// 使用elementplus 组件
app.use(ElementPlus)
//全局注册图标库
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  //图标注册成全局组件，组件名称就是图标的名称
  app.component(key, component)

}

app.mount('#app')
